home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Resources / Chat & Communication / Digsby build 37 / digsby_setup.exe / lib / gui / snap.pyo (.txt) < prev    next >
Python Compiled Bytecode  |  2008-10-13  |  2KB  |  53 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyo (Python 2.5)
  3.  
  4. import wx
  5. from wx import GetMousePosition, Rect, GetTopLevelWindows
  6. from wx import FRAME_SHAPED
  7. from weakref import ref
  8. if 'wxMSW' in wx.PlatformInfo:
  9.     from cgui import WindowSnapper as Snapper
  10. else:
  11.     
  12.     class Snapper(object):
  13.         
  14.         def __init__(self, frame, *a, **k):
  15.             pass
  16.  
  17.         
  18.         def SetEnabled(self, val):
  19.             pass
  20.  
  21.         
  22.         def IsEnabled(self):
  23.             return False
  24.  
  25.  
  26.  
  27. def SetSnap(win, snapping, filter_func = None):
  28.     if not isinstance(snapping, bool):
  29.         raise TypeError('SetSnap first argument must be a bool, got type %r' % type(snapping))
  30.     
  31.     
  32.     try:
  33.         snapper = win._snapper
  34.     except AttributeError:
  35.         snapper = win._snapper = Snapper(win, 12, snapping)
  36.  
  37.     win._snapper.SetEnabled(snapping)
  38.  
  39.  
  40. def GetSnap(win):
  41.     
  42.     try:
  43.         snapper = win._snapper
  44.     except AttributeError:
  45.         return False
  46.  
  47.     return snapper.IsEnabled()
  48.  
  49. import new
  50. wx.TopLevelWindow.GetSnap = new.instancemethod(GetSnap, None, wx.TopLevelWindow)
  51. wx.TopLevelWindow.SetSnap = new.instancemethod(SetSnap, None, wx.TopLevelWindow)
  52. wx.TopLevelWindow.Snap = property(GetSnap, SetSnap)
  53.